package com.bw.exception;

import com.alibaba.fastjson2.JSON;
import com.bw.utils.JsonOutput;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyGlobalExceptionHandler {


    @ExceptionHandler(MyRuntimeException.class)
    public JsonOutput<Object> errorExceptionHandler(Exception e){

        return new JsonOutput<>(-1, e.getMessage());
    }

}
